package com.support;

import org.springframework.core.convert.converter.Converter;

import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZoneOffset;

public enum LocalDateToLongConverter implements Converter<LocalDate,Long> {
    INSTANCE;
    @Override
    public Long convert(LocalDate source) {
        System.out.println("LocalDate to long----");
        return source.atTime(LocalTime.now()).toInstant(ZoneOffset.of("+8")).toEpochMilli();
    }
}
